import request from "@/utils/request";
export const getRoles = () => {
    return request({
        url: '/roles',
        method: 'get'
    })
}
export const changeRoles = (obj) => {
    // console.log(obj,98989)
    return request({
        url: `/users/${obj.id}/role`,
        method: 'put',
        data: {
            rid: obj.rid
        }
    })
}
export const getRolesTree = () => {
    return request({
        url: '/rights/tree',
        method: 'get'
    })
}
export const getRolesList = () => {
    return request({
        url: '/rights/list',
        method: 'get'
    })
}
export const setRolesPoint = (obj) => {
    console.log(obj)
    return request({
        url: `/roles/${obj.id}/rights`,
        method: 'post',
        data: {
            rids:obj.rids
        }
    })
}
export const deleteRoles = (obj) => {
    // console.log(obj)
    return request({
        url: `/roles/${obj.roleId}/rights/${obj.perId}`,
        method: 'delete'
    })
}